////////////////////////////////////////////////////////////////////////////////
#define	_MAIN_C_
////////////////////////////////////////////////////////////////////////////////

/****************************************************************************************/
/*
 *
 * Copyright (C) 2020. Mysentech Inc, unpublished work. This computer 
 * program includes Confidential, Proprietary Information and is a Trade Secret of 
 * Minyuan Sensing Technology Inc.(Mysentech)  All use, disclosure, and/or reproduction is prohibited 
 * unless authorized in writing. All Rights Reserved.
 *
 *  Please contact <sales@mysentech.com> or contributors for further questions.
*/
/****************************************************************************************/

#include "main.h"
#include "oled.h"

CAP_AFE_SingleEnded cap_structure ;
MC1081_InitStructure cap_init_structure ;

u16 ch[3];
float fre[3];
float cap[3];
char s[20];
int main(void){	
	/*!< Init Oled Display */
	OLED_Init();
	/*!< Init USART MODE */
	Uart_ConfigInit(115200);
	/*!< Set the OSC1 mode */
    cap_init_structure.MC1081_OSC_MODE = OSC1;
    /* Configure shield mode */
    cap_init_structure.MC1081_SHLD_CFG = SHLD_DIS;
	Cap_Afe_Init(&cap_init_structure);	

    while (1){
		MC1081_T_Measure(&cap_structure.temp);
		MC1081_OSC1_Measure(&cap_structure,&cap_init_structure);	
		for(u8 index=0;index<3;index++)
		{
			ch[index]	= 	cap_structure.data_ch[2+index];
			fre[index]	= cap_structure.freq_ch[2+index];
			cap[index]	= cap_structure.cap_ch[2+index];
		}
		/*!< Clear OlED Display */
		OLED_Clear();
		/*!< Display temperature value on the OLED screen */
		Oled_Display_Temp(cap_structure.temp,1);
		/*!< Display integer data values on the OLED screen */
		Oled_Display_Datas(ch,2,3);
		/*!< Display frequency values on the OLED screen */
//		Oled_Display_Fres(fre,2,3);
		/*!< Display capacitance values on the OLED screen */
//		Oled_Display_Caps(cap,2,3);
		
    }
}

